import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      component: () => import('@/views/login/index.vue'),
    },
    {
      path: '/',
      component: () => import('@/views/layout/index.vue'),

      // redirect: '/article/manage',
      children: [
        {
          path: '/article/manage',
          component: () => import('@/views/article/ArticleManage.vue'),
        },
        {
          path: '/article/category',
          component: () => import('@/views/article/ArticleCategory.vue'),
        },
        {
          path: '/user/info',
          component: () => import('@/views/user/index.vue'),
        },
        {
          path: '/user/changeHeadPic',
          component: () => import('@/views/user/ChangeHeadPic.vue'),
        },
        {
          path: '/user/resetPwd',
          component: () => import('@/views/user/ResetPwd.vue'),
        },
      ],
    },
  ],
})

export default router
